package com.wsjj.yjh.server.impl;

import com.wsjj.yjh.bean.KafkaTable;
import com.wsjj.yjh.mapper.KafkaTableMapper;
import com.wsjj.yjh.server.KafkaTableServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class KafkaTableServerImpl implements KafkaTableServer {
    @Autowired
    KafkaTableMapper kafkaTableMapper;

    @Override
    public KafkaTable selectById() {
        Integer coumt = kafkaTableMapper.selectCoumt();
        Random random = new Random();
        int id = random.nextInt(coumt);

        return kafkaTableMapper.selectById(id+1);

    }
}
